<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        const username = 'yy';
        const age = 18;

        const obj = {
            username,
            age,
            // say : function() {}
            say() {
                console.log(888);
            }
        }

        console.log(obj);



        // 沙箱简写

        function outer() {
            let a = 1;
            return {
                get() {
                    return a
                },
                set(v) {
                    a = v
                }
            }
        }

    </script>

</body>

</html>